package bluejack.operation;

/**
 * ...
 * @author BlueJack
 */

class RetryOper extends TimeoutOper
{
	public var maxRetry:Int;
	private var retry:Int;

	public function new() {
		maxRetry = 3;
		retry = 0;
		super(500);
	}
	
	override public function fault(event:Dynamic = null):Void {
		if (retry < maxRetry) {
			retry ++;
			execute();
		}else {
			super.fault(event);
		}
	}
}